package com.cheetah.start.module.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cheetah.start.common.base.BaseEntity;
import com.cheetah.start.common.base.validation.Add;
import com.cheetah.start.common.base.validation.Edit;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


/**
 * 角色
 *
 * @author Feel
 * @date 2021/09/05
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_role")
public class SysRole extends BaseEntity {


    @TableId(value = "role_id")
    @NotNull(message = "ID不能为空", groups = {Edit.class})
    private Integer roleId;

    /**
     * 角色名
     */
    @NotBlank(message = "角色名不能为空", groups = {Add.class, Edit.class})
    private String roleName;

    /**
     * 角色代码
     */
    @NotBlank(message = "角色标识不能为空", groups = {Add.class, Edit.class})
    private String roleCode;

    /**
     * 是否启用
     */
    @NotBlank(message = "是否启用不能为空", groups = {Add.class, Edit.class})
    private String enable;

    /**
     * 细节
     */
    private String details;

    /**
     * 排序
     */
    private Integer sort;


    /**
     * 提供前端 显示
     */
    @TableField(exist = false)
    private boolean checked = false;
}
